package ij3d.geom;

/**
 *  Description of the Class
 *
 *@author     cedric
 *@created    12 novembre 2003
 */
public class Pixel3D extends Point3D {

    /**
     *  Description of the Field
     */ 
        double value;

    /**
     *  constructeurs
     */ 
        public Pixel3D() {
                super();
                value = Float.NaN;
        }

    /**
     *  constructeurs
     *
     *@param  x      Description of the Parameter
     *@param  y      Description of the Parameter
     *@param  z      Description of the Parameter
     *@param val
     */ 
        public Pixel3D(int x, int y, int z, float val) {
                super(x,y,z);
                value = val;
        }

    /**
     *  Constructor for the Pixel3D object
     *
     *@param  x      Description of the Parameter
     *@param  y      Description of the Parameter
     *@param  z      Description of the Parameter
     *@param val
     */ 
        public Pixel3D(int x, int y, int z, double val) {
                super(x,y,z);
                value = val;
        }
 
        /**
         *
         * @param x
         * @param y
         * @param z
         * @param val
         */
        public Pixel3D(double x, double y, double z, double val){
 
                super(x,y,z);
                value = val;
        }
 

    /**
     *  Sets the pixel attribute of the Pixel3D object
     *
     *@param  x      The new pixel value
     *@param  y      The new pixel value
     *@param  z      The new pixel value
     *@param  value  The new pixel value
     */ 
        public void setPixel(int x, int y, int z, float value) {
                setX(x);
                setY(y);
                setZ(z);
                this.value = value;
        }

    /**
     *  Sets the pixel attribute of the Pixel3D object
     *
     *@param  x      The new pixel value
     *@param  y      The new pixel value
     *@param  z      The new pixel value
     *@param  value  The new pixel value
     */ 
        public void setPixel(int x, int y, int z, double value) {
                setX(x);
                setY(y);
                setZ(z);
                this.value = (float) value;
        }

    /**
     *  Gets the value attribute of the Pixel3D object
     *
     *@return    The value value
     */ 
        public double getValue() {
                return value;
        }

 
        @Override public String toString() {
                return ("(" + getX() + " , " + getY() + " , " + getZ() + ")");
        }

    /**
     *  Description of the Method
     *
     *@param  autre  Description of the Parameter
     *@return        Description of the Return Value
     */ 
        public double dist(Pixel3D autre) {
                return Math.sqrt(((getX() - autre.getX()) * (getX() - autre.getX())) + ((getY() - autre.getY()) * (getY() - autre.getY())) + ((getZ() - autre.getZ()) * (getZ() - autre.getZ())));
        }
}

